<form id="migration" method="post" action="{:url('muushop/Api/service',['action'=>'return_express'])}" class="form-horizontal">
    <input type="hidden" name="id" value="{$data.id}">
    {notempty name="delivery"}
    <!--发货&&改物流-->
    <div class="form-group">
        <label class="col-sm-2">快递公司：</label>
        <div class="col-md-8">
            <select class="form-control" name="ShipperValue">
                {foreach name="delivery" item="vo" }
                <option value ="{$vo},{$key}" 
                {notempty name="$order.delivery_info.ShipperCode"}
                {eq name="order.delivery_info.ShipperCode" value="$key"}selected{/eq}
                {/notempty}
                >{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2">快递单号：</label>
        <div class="col-md-8">
            <input type="text" class="form-control" name="LogisticCode" value="{notempty name="$order.delivery_info"}{$order.delivery_info.LogisticCode}{/notempty}">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2"></label>
        <div class="col-md-8">
            <button data-role="submit" class="btn btn-primary">确认</button>
            <button class="btn" data-dismiss="modal">取消</button>
        </div>
    </div>
    {else /}
    <div class="text-center">未配置物流插件或不支持的插件</div>
    {/notempty}
</form>
<script>
    $(function(){
        $('[data-role="submit"]').click(function(e){
            e.preventDefault();
            var query=$('#migration').serialize();
            var url=$('#migration').attr('action');
            $.post(url,query,function(res){
                if(res.code){
                    toast.success(res.msg);
                    setTimeout(function(){
                        window.location.href=res.url;
                    },1500);
                }else{
                    handleAjax(res.msg);
                }
            },'json');
        });
    });
</script>